package demo3;
//接口不能通过new关键字进行实例化
//类和接口通过关键字implements实现接口

interface IShape{
   public static final int a=10;//灰色的说明是（接口的）默认类型，可以不写，反正默认
   public abstract void draw();
default public void test(){//接口中不可以有普通方法，除非前面加关键字default
   System.out.println("test()");
}
public static void test2(){
   System.out.println("test2()");
}
}
class Rect implements IShape{
   @Override
   public void draw() {
      System.out.println("矩形");
   }
}
class Flower implements IShape{
   @Override
   public void draw() {
      System.out.println("❀");
   }
}



public class Test {
   public static void drawMap(IShape iShape){
      iShape.draw();
   }
   public static void main(String[] args) {
     IShape iShape1=new Rect();
     iShape1.draw();
      drawMap(new Flower());

   }
}
